<?php


namespace App\Model;


use Illuminate\Database\Eloquent\Model;

class OrderGoods extends Model
{
    const CREATED_AT = 'createtime';

    //表名
    protected $table = 'order_goods';

    public function getGoodsPriceAttribute($value)
    {
        return bcdiv($value, 100, 2);
    }

    protected function setGoodsPriceAttribute($value)
    {
        return bcmul($value, 100, 0);
    }

    public function getTotalPriceAttribute($value)
    {
        return bcdiv($value, 100, 2);
    }

    protected function setTotalPriceAttribute($value)
    {
        return bcmul($value, 100, 0);
    }
}
